/**
 * 
 */
package org.t2.backstage.module.gameserver.model;

import org.banish.sql.core.annotation.Column;
import org.banish.sql.core.annotation.Id;
import org.banish.sql.core.annotation.Index;
import org.banish.sql.core.annotation.Table;
import org.banish.sql.core.annotation.Id.Strategy;
import org.banish.sql.core.annotation.enuma.IndexType;
import org.gaming.service.repository.annotation.NoCache;
import org.gaming.service.service.redis.OneToManyEntity;
import org.springframework.stereotype.Repository;

/**
 * @author YY
 *
 */
@Repository
@NoCache(relation = {"channelId", "serverId"})
@Table(comment = "游戏渠道与服务器关系表", dbAlias = "backstage", indexs = {
		@Index(fields = { "channelId" }),
		@Index(fields = { "channelId", "serverId" }, type = IndexType.UNIQUE)})
public class GameChannelServer extends OneToManyEntity {
	@Id(strategy = Strategy.AUTO, autoBase = 1)
	@Column(comment = "关系ID")
	private long id;
	@Column(comment = "渠道ID", readonly = true)
	private long channelId;
	@Column(comment = "渠道名字")
	private String channelName;
	@Column(comment = "服务器唯一ID", readonly = true)
	private int serverUid;
	@Column(comment = "服务器ID", readonly = true)
	private int serverId;
	@Column(comment = "服务器名字")
	private String serverName;
	@Column(comment = "所属大区ID")
	private int regionId;
	@Column(comment = "所属大区名称")
	private String regionName;
	@Column(comment = "操作员ID", readonly = true)
	private long userId;
	@Column(comment = "操作员名称", readonly = true)
	private String userName;
	@Column(comment = "是否为推荐服务器")
	private boolean recommend;
	
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public int getServerId() {
		return serverId;
	}
	public void setServerId(int serverId) {
		this.serverId = serverId;
	}
	public String getServerName() {
		return serverName;
	}
	public void setServerName(String serverName) {
		this.serverName = serverName;
	}
	@Override
	public Long redisOwnerKey() {
		return channelId;
	}
	@Override
	public Long redisHashKey() {
		return (long)serverId;
	}
	public long getChannelId() {
		return channelId;
	}
	public void setChannelId(long channelId) {
		this.channelId = channelId;
	}
	public String getChannelName() {
		return channelName;
	}
	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}
	public String getRegionName() {
		return regionName;
	}
	public void setRegionName(String regionName) {
		this.regionName = regionName;
	}
	public long getUserId() {
		return userId;
	}
	public void setUserId(long userId) {
		this.userId = userId;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public int getServerUid() {
		return serverUid;
	}
	public void setServerUid(int serverUid) {
		this.serverUid = serverUid;
	}
	public int getRegionId() {
		return regionId;
	}
	public void setRegionId(int regionId) {
		this.regionId = regionId;
	}
	public boolean isRecommend() {
		return recommend;
	}
	public void setRecommend(boolean recommend) {
		this.recommend = recommend;
	}
}
